myCompanyController = BaseController.extend({
	template:'myCompany',
	center:'我的连',
	mainView: 'partnerManage',
	waitOn:function(self){
		var company = this.currentUser();
		if(this.params.id){
					console.log('company id1:');
					console.log(this.params.id);
					this.dcom = {parent_id: parseInt(this.params.id)};
					Meteor.subscribe('partners',{parent_id: parseInt(this.params.id)}, {});
		}else{
					console.log('company id2:');
					console.log(company.id);
					this.dcom = {parent_id:parseInt(company.id)};
					Meteor.subscribe('partners',{parent_id:parseInt(company.id)}, {});
		}
	},
	onRendered:function(self){
	},
	data:function(){
		var self = this;
		return{
			companyInfo : function(){
				return Partners.find(self.dcom).fetch();
			}
		}
	},
})

myPlatoonController = BaseController.extend({
	template:'myPlatoon',
	center:'我的排',
	mainView: 'partnerManage',
	waitOn:function(){
		let self = this;
		var platoon = this.currentUser();
		if(this.params.id){
					console.log('platoon id3:');
					console.log(this.params.id);
					this.dpla = {parent_id: parseInt(this.params.id)};
					Meteor.subscribe('partners',{parent_id: parseInt(this.params.id)}, {});
		}else{
					console.log('platoon id4:');
					console.log(platoon.id);
					this.dpla = {parent_id:parseInt(platoon.id)};
					Meteor.subscribe('partners',{parent_id:parseInt(platoon.id)}, {});
		}
	},
	data:function(){
		var self = this;
		return{
			platoonInfo : function(){
				return Partners.find(self.dpla).fetch();
			}
		}
	},
})


myMonitorController = BaseController.extend({
	template:'myMonitor',
	center:'我的班',
	mainView: 'partnerManage',
	waitOn:function(self){
		//let self = this;
		var monitor = this.currentUser();
		if(this.params.id){
					console.log('monitor id5:');
					console.log(this.params.id);
					this.dmon = {partner_id: parseInt(this.params.id)};
					Meteor.subscribe('classCodes',{partner_id: parseInt(this.params.id)}, {});
		}else{
					console.log('monitor id6:');
					console.log(monitor.id);
					this.dmon = {partner_id: parseInt(monitor.id)};
					Meteor.subscribe('classCodes',{partner_id: parseInt(monitor.id)}, {});
		}
	},
	data:function(){
		var self = this;
		return{
			monitorInfo: function(){
				return ClassCodes.find(self.dmon).fetch();
			},
		}
	},
})
